package hankz.spring.beans.factory.support;

import hankz.spring.beans.BeansException;
import hankz.spring.core.io.Resource;
import hankz.spring.core.io.ResourceLoader;

/**
 * @description: Bean定义读取接口
 *
 * @author: zzc
 * @modified By: zzc
 * @date: Created in 2021/11/21 15:38
 * @version:v1.0
 */
public interface BeanDefinitionReader {

    /**
     * getRegistry()、getResourceLoader()，都是用于提供给后面三个方法的工具，加载和注册，
     * 这两个方法的实现会包装到抽象类中，以免污染具体的接口实现方法
     */
    BeanDefinitionRegistry getRegistry();

    ResourceLoader getResourceLoader();

    void loadBeanDefinitions(Resource resource) throws BeansException;

    void loadBeanDefinitions(Resource... resources) throws BeansException;

    void loadBeanDefinitions(String location) throws BeansException;

    void loadBeanDefinitions(String... locations) throws BeansException;

}
